package com.example.zllchart;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.data.Common;
import com.data.LineData;
import com.data.MyData;
import com.google.gson.Gson;
import com.model.LineModel;
import com.model.ReferenceModel;
import com.view.AxisXView;
import com.view.AxisYTitle;
import com.view.AxisYView;
import com.view.LineView;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.data.Common.LineDataSeries;
import static com.data.Common.mLineModel;
import static com.data.Common.mReferenceModel;
import static com.data.Common.newX;


public class LineChartActivity extends Activity {
    @BindView(R.id.mBack)
    TextView mBack;
    @BindView(R.id.mTitle)
    TextView mTitle;
    @BindView(R.id.mMenu)
    TextView mMenu;
    @BindView(R.id.mHeightLayoutLine)
    View mHeightLayoutLine;
    @BindView(R.id.mHeightLayout)
    AutoLinearLayout mHeightLayout;
    @BindView(R.id.mWeightLayoutLine)
    View mWeightLayoutLine;
    @BindView(R.id.mWeightLayout)
    AutoLinearLayout mWeightLayout;
    @BindView(R.id.mHeadLayoutLine)
    View mHeadLayoutLine;
    @BindView(R.id.mHeadLayout)
    AutoLinearLayout mHeadLayout;
    @BindView(R.id.mNowView)
    ImageView mNowView;
    @BindView(R.id.mBabyBirthday)
    TextView mBabyBirthday;
    @BindView(R.id.mAxisTitleLayout)
    AutoLinearLayout mAxisTitleLayout;
    @BindView(R.id.mAxisYLayout)
    AutoLinearLayout mAxisYLayout;
    @BindView(R.id.mLineViewLayout)
    AutoLinearLayout mLineViewLayout;
    @BindView(R.id.mAxisXLayout)
    AutoLinearLayout mAxisXLayout;
    @BindView(R.id.mPointBabyBirthdaySec)
    TextView mPointBabyBirthdaySec;
    @BindView(R.id.mPointTitle)
    TextView mPointTitle;
    @BindView(R.id.mPointContent)
    TextView mPointContent;
    @BindView(R.id.mPointSub)
    TextView mPointSub;
    @BindView(R.id.mBottomLayout)
    AutoRelativeLayout mBottomLayout;
    @BindView(R.id.mHeightLayoutLineText)
    TextView mHeightLayoutLineText;
    @BindView(R.id.mWeightLayoutLineText)
    TextView mWeightLayoutLineText;
    @BindView(R.id.mHeadLayoutLineText)
    TextView mHeadLayoutLineText;

    private LineView mLineView;
    private AxisYView mAxisY;
    private AxisXView mAxisX;
    private AxisYTitle mAxisTitle;


    private List<ArrayList<String>> mHeightReferenceNumbers = new ArrayList<>();
    private List<ArrayList<String>> mWeightReferenceNumbers = new ArrayList<>();
    private List<ArrayList<String>> mHeadReferenceNumbers = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.chartactivity);
        ButterKnife.bind(this);
        init();
    }


    /**
     * 初始化各绘图组件
     * 包括设置高宽、位置
     */
    private void init() {

        //实例化View
        mAxisY = new AxisYView(this);
        mAxisX = new AxisXView(this);
        mAxisTitle = new AxisYTitle(this);
        mLineView = new LineView(this);

        initJsonDate();

        Common.type = 0;
        toDrawView();
    }

    private void toDrawView() {
        //设置各种图的参数
        mAxisXLayout.post(new Runnable() {
            @Override
            public void run() {
                setAxisDate();
                setLineDate();
                addView();
            }
        });
    }

    private void initJsonDate() {
        Gson mGson = new Gson();
        mReferenceModel = null;
        mReferenceModel = mGson.fromJson(json1, ReferenceModel.class);
        mLineModel = mGson.fromJson(json2, LineModel.class);
    }

    private void setLineDate() {


        MyData data = new MyData();
        data.name = "用户数据";
        data.color = 0xff57D9BF;
        data.type = MyData.DataType.NORMAL;
        data.height = new ArrayList<>();
        data.weight = new ArrayList<>();
        data.head = new ArrayList<>();

        for (LineModel.ListBean item : mLineModel.list) {
            int year = Integer.parseInt(item.year);
            int month = Integer.parseInt(item.month);
            int day = Integer.parseInt(item.day);
            int day_number = Integer.parseInt(item.day_number);

            LineData height = new LineData(0f, 0f);
            LineData weight = new LineData(0f, 0f);
            LineData head = new LineData(0f, 0f);

            if (year < 1) {//0岁
                head.x = weight.x = height.x = month * Common.xScaleEachLength +
                        day * (Common.xScaleEachLength / day_number) +
                        2 * Common.xScaleEachLength;

                head.y = weight.y = height.y = Common.getYDataPoint(Float.parseFloat(item.height), 0);
            } else if (year < 3) {//1岁 2岁
                head.x = weight.x = height.x = 12 * Common.xScaleEachLength + //1岁
                        (year - 1) * 6 * Common.xScaleEachLength +
                        (month / 2) * Common.xScaleEachLength +
                        day * (Common.xScaleEachLength / day_number) +
                        2 * Common.xScaleEachLength;

                head.y = weight.y = height.y = Common.getYDataPoint(Float.parseFloat(item.height), 0);
            } else if (year < 8) {//3,4,5,6,7岁
                head.x = weight.x = height.x = 12 * Common.xScaleEachLength + //1岁
                        6 * Common.xScaleEachLength +//2岁
                        6 * Common.xScaleEachLength +//3岁
                        (year - 3) * 2 * Common.xScaleEachLength +
                        (month / 6) * Common.xScaleEachLength +
                        day * (Common.xScaleEachLength / day_number) +
                        2 * Common.xScaleEachLength;

                head.y = weight.y = height.y = Common.getYDataPoint(Float.parseFloat(item.height), 0);
            }

            data.height.add(height);
            data.weight.add(weight);
            data.head.add(head);
        }

        //------------------------------------------------------------------
        mHeightReferenceNumbers.clear();
        mWeightReferenceNumbers.clear();
        mHeadReferenceNumbers.clear();

        for (ReferenceModel.ListBean item : mReferenceModel.list) {
            ArrayList<String> numbers;

            //---------------------------------------------
            numbers = new ArrayList<>();
            for (int i = 0; i < item.height.size(); i++) {
                String number = item.height.get(i);
                numbers.add(number);
            }
            mHeightReferenceNumbers.add(numbers);
            //---------------------------------------------
            numbers = new ArrayList<>();
            for (String number : item.weight) {
                numbers.add(number);
            }
            mWeightReferenceNumbers.add(numbers);
            //---------------------------------------------
            numbers = new ArrayList<>();
            for (String number : item.head) {
                numbers.add(number);
            }
            mHeadReferenceNumbers.add(numbers);
        }

        MyData data0 = new MyData();
        data0.name = "3%";
        data0.color = 0xff57D9BF;
        data0.type = MyData.DataType.REFERENCE;
        data0.height = new ArrayList<>();
        data0.weight = new ArrayList<>();
        data0.head = new ArrayList<>();
        for (int i = 0; i < mHeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(0)), 0));
                data0.height.add(item);
            }
        }

        for (int i = 0; i < mWeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mWeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(0)), 1));
                data0.weight.add(item);
            }
        }

        for (int i = 0; i < mHeadReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeadReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(0)), 2));
                data0.head.add(item);
            }
        }
//---------------------------------------------------
        MyData data1 = new MyData();
        data1.name = "15%";
        data1.color = 0xff57D9BF;
        data1.type = MyData.DataType.REFERENCE;
        data1.height = new ArrayList<>();
        data1.weight = new ArrayList<>();
        data1.head = new ArrayList<>();

        for (int i = 0; i < mHeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(1)), 0));
                data1.height.add(item);
            }
        }

        for (int i = 0; i < mWeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mWeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(1)), 1));
                data1.weight.add(item);
            }
        }

        for (int i = 0; i < mHeadReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeadReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(1)), 2));
                data1.head.add(item);
            }
        }
//---------------------------------------------------
        MyData data2 = new MyData();
        data2.name = "50%";
        data2.color = 0xff57D9BF;
        data2.type = MyData.DataType.REFERENCE;
        data2.height = new ArrayList<>();
        data2.weight = new ArrayList<>();
        data2.head = new ArrayList<>();
        for (int i = 0; i < mHeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(2)), 0));
                data2.height.add(item);
            }
        }

        for (int i = 0; i < mWeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mWeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(2)), 1));
                data2.weight.add(item);
            }
        }

        for (int i = 0; i < mHeadReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeadReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(2)), 2));
                data2.head.add(item);
            }
        }
//---------------------------------------------------
        MyData data3 = new MyData();
        data3.name = "85%";
        data3.color = 0xff57D9BF;
        data3.type = MyData.DataType.REFERENCE;
        data3.height = new ArrayList<>();
        data3.weight = new ArrayList<>();
        data3.head = new ArrayList<>();
        for (int i = 0; i < mHeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(3)), 0));
                data3.height.add(item);
            }
        }

        for (int i = 0; i < mWeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mWeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(3)), 1));
                data3.weight.add(item);
            }
        }

        for (int i = 0; i < mHeadReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeadReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(3)), 2));
                data3.head.add(item);
            }
        }
//---------------------------------------------------
        MyData data4 = new MyData();
        data4.name = "97%";
        data4.color = 0xff57D9BF;
        data4.type = MyData.DataType.REFERENCE;
        data4.height = new ArrayList<>();
        data4.weight = new ArrayList<>();
        data4.head = new ArrayList<>();
        for (int i = 0; i < mHeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(4)), 0));
                data4.height.add(item);
            }
        }

        for (int i = 0; i < mWeightReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mWeightReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(4)), 1));
                data4.weight.add(item);
            }
        }

        for (int i = 0; i < mHeadReferenceNumbers.size(); i++) {
            ArrayList<String> numbers = mHeadReferenceNumbers.get(i);
            if (numbers.size() > 0) {
                LineData item = new LineData(Common.xScaleEachLength * (i + Common.xOffsetNumber),
                        Common.getYDataPoint(Float.parseFloat(numbers.get(4)), 2));
                data4.head.add(item);
            }
        }
//---------------------------------------------------
        LineDataSeries.clear();
        LineDataSeries.add(data);
        LineDataSeries.add(data0);
        LineDataSeries.add(data1);
        LineDataSeries.add(data2);
        LineDataSeries.add(data3);
        LineDataSeries.add(data4);
    }

    private void setAxisDate() {

        List<String> xScaleArray = new ArrayList<>();

        //添加两个空数据
        for (int i = 0; i < Common.xOffsetNumber; i++) {
            xScaleArray.add("");
        }

        //拿出所有x轴的label
        for (ReferenceModel.ListBean item : mReferenceModel.list) {
            xScaleArray.add(item.lable);
        }

        Common.xScaleArrayLabel = xScaleArray;
        Common.xScaleColor = 0xff666666;
        Common.xScaleEachLength = mAxisXLayout.getWidth() / 4;
        Common.xScaleTotalLength = Common.xScaleEachLength * Common.xScaleArrayLabel.size();

        //设置y轴参数
        switch (Common.type) {
            case 0:
                Common.yScaleArrayLabelHeight = new int[]{25, 35, 45, 55, 65, 75, 85, 95, 105, 115, 125, 135};
                break;
            case 1:
                Common.yScaleArrayLabelHeight = new int[]{0, 4, 8, 12, 16, 20, 24, 28, 32, 36};
                break;
            case 2:
                Common.yScaleArrayLabelHeight = new int[]{25, 30, 35, 40, 45, 50, 55, 60};
                break;
        }

        Common.yScaleColor = 0xff666666;
        Common.yScaleEachLength = mAxisYLayout.getHeight() / 5;
        Common.yScaleTotalLength = Common.yScaleEachLength * Common.yScaleArrayLabelHeight.length;

        Common.initYBeginsPoint();
        newX = 0;
        Common.newY = Common.yScaleTotalLength;

        Common.parentWidth = mLineViewLayout.getWidth();
        Common.parentHeight = mLineViewLayout.getHeight();
    }

    private void addView() {

        Common.staticY = Common.yScaleTotalLength - mAxisYLayout.getHeight();

        mLineView.initValue();
        mLineView.scrollTo(0, Common.staticY);

        mAxisY.initValue(Common.yScaleTotalLength, mAxisYLayout.getWidth());//传入高度
        mAxisY.scrollTo(0, Common.staticY);

        mAxisX.initValue(Common.xScaleTotalLength, mAxisXLayout.getHeight());
        mAxisX.scrollTo(0, 0);

        mAxisTitle.initValue(Common.yScaleTotalLength, mAxisTitleLayout.getWidth());
        mAxisY.scrollTo(0, Common.staticY);

        mAxisYLayout.removeAllViews();
        mAxisYLayout.addView(mAxisY);

        mAxisXLayout.removeAllViews();
        mAxisXLayout.addView(mAxisX);

        mLineViewLayout.removeAllViews();
        mLineViewLayout.addView(mLineView);

        mAxisTitleLayout.removeAllViews();
        mAxisTitleLayout.addView(mAxisTitle);

        mLineView.setOnTouchListenerCurrentView(new LineView.OnTouchListenerCurrentView() {
            @Override
            public boolean onTouch(View v, MotionEvent event, int indexX) {

                findUserPoint(indexX);

                if (event.getAction() == MotionEvent.ACTION_MOVE) {
                    mLineView.scrollTo(Common.newX, Common.newY);
                    mAxisY.scrollTo(0, Common.newY);
                    mAxisX.scrollTo(Common.newX, 0);
                    mAxisTitle.scrollTo(0, Common.newY);
                    mAxisTitle.refreshData(indexX);
                }

                return true;
            }
        });
    }

    private void findUserPoint(int indexX) {
        int userDataIndex = -1;

        switch (Common.type) {
            case 0:
                userDataIndex = findUserData(Common.LineDataSeries.get(0).height, indexX);
                break;
            case 1:
                userDataIndex = findUserData(Common.LineDataSeries.get(0).weight, indexX);
                break;
            case 2:
                userDataIndex = findUserData(Common.LineDataSeries.get(0).head, indexX);
                break;
        }

        //发送数据显示
        if (userDataIndex == -1) {
            //没有数据
            LineModel.ListBean item = new LineModel.ListBean();
            item.bb_age = "";
            item.height = "- ";
            item.head = "- ";
            item.weight = "- ";
            item.indexX = indexX;

            Message msg = Message.obtain();
            msg.obj = item;
            mHandler.sendMessage(msg);
        } else {
            //有数据
            LineModel.ListBean item = mLineModel.list.get(userDataIndex);
            item.indexX = indexX;

            Message msg = Message.obtain();
            msg.obj = item;
            mHandler.sendMessage(msg);
        }
    }

    /**
     * 找到数据源是第几项
     *
     * @param array
     * @param indexX
     * @return
     */
    private int findUserData(ArrayList<LineData> array, int indexX) {
        switch (Common.type) {
            case 0:
                for (int i = 0; i < array.size(); i++) {
                    if (Common.LineDataSeries.get(0).height.get(i).x <= indexX + 1 && Common.LineDataSeries.get(0).height.get(i).x >= indexX - 1) {
                        return i;
                    }
                }
                break;
            case 1:
                for (int i = 0; i < array.size(); i++) {
                    if (Common.LineDataSeries.get(0).weight.get(i).x <= indexX + 1 && Common.LineDataSeries.get(0).weight.get(i).x >= indexX - 1) {
                        return i;
                    }
                }
                break;
            case 2:
                for (int i = 0; i < array.size(); i++) {
                    if (Common.LineDataSeries.get(0).head.get(i).x <= indexX + 1 && Common.LineDataSeries.get(0).head.get(i).x >= indexX - 1) {
                        return i;
                    }
                }
                break;
        }

        return -1;
    }


    private int findReferenceData(int indexX) {
        for (int i = 0; ; ) {
            if (indexX <= i * Common.xScaleEachLength) {
                return i;
            } else {
                i++;
            }

            //做个死循环的保险...
            if (i > 1000) {
                return -1;
            }
        }
    }

    private MyHandler mHandler = new MyHandler(this);

    private static class MyHandler extends Handler {
        WeakReference<LineChartActivity> mActivity;

        MyHandler(LineChartActivity activity) {
            mActivity = new WeakReference<>(activity);
        }

        @Override
        public void handleMessage(Message msg) {
            LineChartActivity activity = mActivity.get();
            if (msg.obj != null && activity != null) {
                LineModel.ListBean item1 = (LineModel.ListBean) msg.obj;
                activity.mPointBabyBirthdaySec.setText(item1.bb_age);

                int referenceIndex = activity.findReferenceData(item1.indexX);
                ReferenceModel.ListBean item2 = null;

                if (referenceIndex != -1 && referenceIndex < mReferenceModel.list.size()) {
                    item2 = mReferenceModel.list.get(referenceIndex);
                } else {
                    item2 = null;
                }

                StringBuilder sb = new StringBuilder();
                switch (Common.type) {
                    case 0:
                        activity.mPointTitle.setText("身高");
                        activity.mPointContent.setText(item1.height + "cm");

                        if (item2 != null && item2.height != null && item2.height.size() > 1) {
                            sb.append("参考身高：");
                            sb.append(item2.height.get(0));
                            sb.append("cm");
                            sb.append(" - ");
                            sb.append(item2.height.get(item2.height.size() - 1));
                            sb.append("cm");
                            activity.mPointSub.setText(sb.toString());
                        } else {
                            activity.mPointSub.setText("");
                        }

                        break;
                    case 1:
                        activity.mPointTitle.setText("体重");
                        activity.mPointContent.setText(item1.weight + "kg");

                        if (item2 != null && item2.weight != null && item2.weight.size() > 1) {
                            sb.append("参考体重：");
                            sb.append(item2.weight.get(0));
                            sb.append("kg");
                            sb.append(" - ");
                            sb.append(item2.weight.get(item2.weight.size() - 1));
                            sb.append("kg");
                            activity.mPointSub.setText(sb.toString());
                        } else {
                            activity.mPointSub.setText("");
                        }

                        break;
                    case 2:
                        activity.mPointTitle.setText("头围");
                        activity.mPointContent.setText(item1.head + "cm");

                        if (item2 != null && item2.head != null && item2.head.size() > 1) {
                            sb.append("参考头围：");
                            sb.append(item2.head.get(0));
                            sb.append("cm");
                            sb.append(" - ");
                            sb.append(item2.head.get(item2.head.size() - 1));
                            sb.append("cm");
                            activity.mPointSub.setText(sb.toString());
                        } else {
                            activity.mPointSub.setText("");
                        }
                        break;
                }
            }
        }
    }

    @OnClick({R.id.mHeightLayout, R.id.mWeightLayout, R.id.mHeadLayout, R.id.mNowView})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.mHeightLayout:
                mHeightLayoutLine.setVisibility(View.VISIBLE);
                mHeightLayoutLineText.setTextColor(0xff57D9BF);
                mWeightLayoutLine.setVisibility(View.GONE);
                mWeightLayoutLineText.setTextColor(0xff666666);
                mHeadLayoutLine.setVisibility(View.GONE);
                mHeadLayoutLineText.setTextColor(0xff666666);

                Common.type = 0;
                toDrawView();
                break;
            case R.id.mWeightLayout:
                mHeightLayoutLine.setVisibility(View.GONE);
                mHeightLayoutLineText.setTextColor(0xff666666);
                mWeightLayoutLine.setVisibility(View.VISIBLE);
                mWeightLayoutLineText.setTextColor(0xff57D9BF);
                mHeadLayoutLine.setVisibility(View.GONE);
                mHeadLayoutLineText.setTextColor(0xff666666);

                Common.type = 1;
                toDrawView();
                break;
            case R.id.mHeadLayout:
                mHeightLayoutLine.setVisibility(View.GONE);
                mHeightLayoutLineText.setTextColor(0xff666666);
                mWeightLayoutLine.setVisibility(View.GONE);
                mWeightLayoutLineText.setTextColor(0xff666666);
                mHeadLayoutLine.setVisibility(View.VISIBLE);
                mHeadLayoutLineText.setTextColor(0xff57D9BF);

                Common.type = 2;
                toDrawView();
                break;
            case R.id.mNowView:
                toToday();
                break;
        }
    }

    private void toToday() {
        int year = Integer.parseInt(mLineModel.today.year);
        int month = Integer.parseInt(mLineModel.today.month);
        int day = Integer.parseInt(mLineModel.today.day);
        int day_number = Integer.parseInt(mLineModel.today.day_number);

        int XscrollTo = 0;
        int YscrollTo = 0;

        if (year < 1) {//0岁
            XscrollTo = month * Common.xScaleEachLength +
                    day * (Common.xScaleEachLength / day_number);

        } else if (year < 3) {//1岁 2岁
            XscrollTo = 12 * Common.xScaleEachLength + //1岁
                    (year - 1) * 6 * Common.xScaleEachLength +
                    (month / 2) * Common.xScaleEachLength +
                    day * (Common.xScaleEachLength / day_number);

        } else if (year < 8) {//3,4,5,6,7岁
            XscrollTo = 12 * Common.xScaleEachLength + //1岁
                    6 * Common.xScaleEachLength +//2岁
                    6 * Common.xScaleEachLength +//3岁
                    (year - 3) * 2 * Common.xScaleEachLength +
                    (month / 6) * Common.xScaleEachLength +
                    day * (Common.xScaleEachLength / day_number);
        }

        switch (Common.type) {
            case 0:
                YscrollTo = Common.staticY - XscrollTo * Common.yScaleTotalLength / (Common.xScaleTotalLength + Common.yScaleEachLength * 20);
                break;
            case 1:
                YscrollTo = Common.staticY - XscrollTo * Common.yScaleTotalLength / (Common.xScaleTotalLength + Common.yScaleEachLength * 120);
                break;
            case 2:
                YscrollTo = Common.staticY - XscrollTo * Common.yScaleTotalLength / (Common.xScaleTotalLength + Common.yScaleEachLength * 20);
                break;
        }

        mAxisY.scrollTo(0, YscrollTo);
        mAxisX.scrollTo(XscrollTo, 0);
        mAxisX.scrollTo(XscrollTo, 0);
        mLineView.scrollTo(XscrollTo, YscrollTo);
        mAxisTitle.scrollTo(0, YscrollTo);
        mAxisTitle.refreshData(XscrollTo + 2 * Common.xScaleEachLength);

        findUserPoint(XscrollTo + 2 * Common.xScaleEachLength);

        Common.newX = XscrollTo;

        Common.oldX = 0;
        Common.oldY = 0;
    }


    private String json2 = "{\n" +
            "\t\"list\": [{\n" +
            "\t\t\"id\": \"11250586\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"120\",\n" +
            "\t\t\"weight\": \"40\",\n" +
            "\t\t\"head\": \"30\",\n" +
            "\t\t\"assessment\": \"\",\n" +
            "\t\t\"record_date\": \"2017-06-07\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"3岁7个月6天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"3\",\n" +
            "\t\t\"month\": \"6\",\n" +
            "\t\t\"day\": \"37\",\n" +
            "\t\t\"day_number\": \"184\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250587\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"105\",\n" +
            "\t\t\"weight\": \"30\",\n" +
            "\t\t\"head\": \"24\",\n" +
            "\t\t\"assessment\": \"\",\n" +
            "\t\t\"record_date\": \"2017-06-04\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"3岁7个月3天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"3\",\n" +
            "\t\t\"month\": \"6\",\n" +
            "\t\t\"day\": \"34\",\n" +
            "\t\t\"day_number\": \"184\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250527\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"89\",\n" +
            "\t\t\"weight\": \"40\",\n" +
            "\t\t\"head\": \"25\",\n" +
            "\t\t\"assessment\": \"\",\n" +
            "\t\t\"record_date\": \"2017-06-01\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"3岁7个月\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"3\",\n" +
            "\t\t\"month\": \"6\",\n" +
            "\t\t\"day\": \"31\",\n" +
            "\t\t\"day_number\": \"184\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250529\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"89\",\n" +
            "\t\t\"weight\": \"11\",\n" +
            "\t\t\"head\": \"45\",\n" +
            "\t\t\"assessment\": \"\",\n" +
            "\t\t\"record_date\": \"2017-01-05\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"3岁2个月4天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"3\",\n" +
            "\t\t\"month\": \"0\",\n" +
            "\t\t\"day\": \"65\",\n" +
            "\t\t\"day_number\": \"181\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250530\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"80\",\n" +
            "\t\t\"weight\": \"40\",\n" +
            "\t\t\"head\": \"25\",\n" +
            "\t\t\"assessment\": \"宝宝身高体重不达标，速找原因来改善！\",\n" +
            "\t\t\"record_date\": \"2016-06-05\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"2岁7个月4天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"2\",\n" +
            "\t\t\"month\": \"6\",\n" +
            "\t\t\"day\": \"35\",\n" +
            "\t\t\"day_number\": \"61\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250589\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"80\",\n" +
            "\t\t\"weight\": \"40\",\n" +
            "\t\t\"head\": \"30\",\n" +
            "\t\t\"assessment\": \"小家伙有点胖，别总是用食物来宠TA咯。\",\n" +
            "\t\t\"record_date\": \"2015-06-07\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"1岁7个月6天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"1\",\n" +
            "\t\t\"month\": \"6\",\n" +
            "\t\t\"day\": \"37\",\n" +
            "\t\t\"day_number\": \"61\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250591\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"61\",\n" +
            "\t\t\"weight\": \"12\",\n" +
            "\t\t\"head\": \"30\",\n" +
            "\t\t\"assessment\": \"宝宝体重标准，但个子不高，别忘了补钙哦！\",\n" +
            "\t\t\"record_date\": \"2015-04-06\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"1岁5个月5天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"1\",\n" +
            "\t\t\"month\": \"4\",\n" +
            "\t\t\"day\": \"36\",\n" +
            "\t\t\"day_number\": \"61\"\n" +
            "\t}, {\n" +
            "\t\t\"id\": \"11250590\",\n" +
            "\t\t\"uid\": \"74333090\",\n" +
            "\t\t\"height\": \"70\",\n" +
            "\t\t\"weight\": \"40\",\n" +
            "\t\t\"head\": \"30\",\n" +
            "\t\t\"assessment\": \"宝宝身高体重不达标，速找原因来改善！\",\n" +
            "\t\t\"record_date\": \"2015-03-06\",\n" +
            "\t\t\"bb_birthday\": \"1383235200\",\n" +
            "\t\t\"bb_age\": \"1岁4个月5天\",\n" +
            "\t\t\"feedback\": \"\",\n" +
            "\t\t\"is_author\": \"1\",\n" +
            "\t\t\"year\": \"1\",\n" +
            "\t\t\"month\": \"4\",\n" +
            "\t\t\"day\": \"5\",\n" +
            "\t\t\"day_number\": \"62\"\n" +
            "\t}],\n" +
            "\t\"today\": {\n" +
            "\t\t\"year\": \"3\",\n" +
            "\t\t\"month\": \"6\",\n" +
            "\t\t\"day\": \"37\",\n" +
            "\t\t\"day_number\": \"184\"\n" +
            "\t}\n" +
            "}\n";

    private String json1 = "{\n" +
            "            \"list\": [{\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"出生\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"46.4\", \"48.0\", \"49.7\", \"51.4\", \"53.2\"],\n" +
            "                  \"weight\": [\"2.54\", \"2.85\", \"3.21\", \"3.63\", \"4.10\"],\n" +
            "                  \"head\": [\"31.6\", \"32.8\", \"34.0\", \"35.2\", \"36.4\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"1\",\n" +
            "                  \"lable\": \"1个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"49.8\", \"51.7\", \"53.7\", \"55.7\", \"57.8\"],\n" +
            "                  \"weight\": [\"3.33\", \"3.74\", \"4.20\", \"4.74\", \"5.35\"],\n" +
            "                  \"head\": [\"33.8\", \"35.0\", \"36.2\", \"37.4\", \"38.6\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"2\",\n" +
            "                  \"lable\": \"2个月\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"53.2\", \"55.3\", \"57.4\", \"59.6\", \"61.8\"],\n" +
            "                  \"weight\": [\"4.15\", \"4.65\", \"5.21\", \"5.86\", \"6.60\"],\n" +
            "                  \"head\": [\"35.6\", \"36.8\", \"38.0\", \"39.3\", \"40.5\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"3\",\n" +
            "                  \"lable\": \"3个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"56.3\", \"58.4\", \"60.6\", \"62.8\", \"65.1\"],\n" +
            "                  \"weight\": [\"4.90\", \"5.47\", \"6.13\", \"6.87\", \"7.73\"],\n" +
            "                  \"head\": [\"37.1\", \"38.3\", \"39.5\", \"40.8\", \"42.1\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"4\",\n" +
            "                  \"lable\": \"4个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"58.8\", \"61.0\", \"63.1\", \"65.4\", \"67.7\"],\n" +
            "                  \"weight\": [\"5.48\", \"6.11\", \"6.83\", \"7.65\", \"8.59\"],\n" +
            "                  \"head\": [\"38.3\", \"39.5\", \"40.7\", \"41.9\", \"43.3\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"5\",\n" +
            "                  \"lable\": \"5个月\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"60.8\", \"62.9\", \"65.2\", \"67.4\", \"69.8\"],\n" +
            "                  \"weight\": [\"5.92\", \"6.59\", \"7.36\", \"8.23\", \"9.23\"],\n" +
            "                  \"head\": [\"39.2\", \"40.4\", \"41.6\", \"42.9\", \"44.3\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"半岁\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"62.3\", \"64.5\", \"66.8\", \"69.1\", \"71.5\"],\n" +
            "                  \"weight\": [\"6.26\", \"6.96\", \"7.77\", \"8.68\", \"9.73\"],\n" +
            "                  \"head\": [\"40.0\", \"41.2\", \"42.4\", \"43.7\", \"45.1\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"7\",\n" +
            "                  \"lable\": \"7个月\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"63.6\", \"65.9\", \"68.2\", \"70.6\", \"73.1\"],\n" +
            "                  \"weight\": [\"6.55\", \"7.28\", \"8.11\", \"9.06\", \"10.15\"],\n" +
            "                  \"head\": [\"40.7\", \"41.8\", \"43.1\", \"44.4\", \"45.7\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"8\",\n" +
            "                  \"lable\": \"8个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"64.8\", \"67.2\", \"69.6\", \"72.1\", \"74.7\"],\n" +
            "                  \"weight\": [\"6.79\", \"7.55\", \"8.41\", \"9.39\", \"10.51\"],\n" +
            "                  \"head\": [\"41.2\", \"42.4\", \"43.6\", \"44.9\", \"46.3\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"9\",\n" +
            "                  \"lable\": \"9个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"66.1\", \"68.5\", \"71.0\", \"73.6\", \"76.2\"],\n" +
            "                  \"weight\": [\"7.03\", \"7.81\", \"8.69\", \"9.70\", \"10.86\"],\n" +
            "                  \"head\": [\"41.7\", \"42.9\", \"44.1\", \"45.4\", \"46.8\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"10\",\n" +
            "                  \"lable\": \"10个月\",\n" +
            "                  \"day_number\": \"28\",\n" +
            "                  \"height\": [\"67.3\", \"69.8\", \"72.4\", \"75.0\", \"77.7\"],\n" +
            "                  \"weight\": [\"7.23\", \"8.03\", \"8.94\", \"9.98\", \"11.16\"],\n" +
            "                  \"head\": [\"42.1\", \"43.3\", \"44.5\", \"45.8\", \"47.2\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"0\",\n" +
            "                  \"month\": \"11\",\n" +
            "                  \"lable\": \"11个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"68.6\", \"71.1\", \"73.7\", \"76.4\", \"79.2\"],\n" +
            "                  \"weight\": [\"7.43\", \"8.25\", \"9.18\", \"10.24\", \"11.46\"],\n" +
            "                  \"head\": [\"42.4\", \"43.6\", \"44.9\", \"46.2\", \"47.5\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"1\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"一岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"69.7\", \"72.3\", \"75.0\", \"77.7\", \"80.5\"],\n" +
            "                  \"weight\": [\"7.61\", \"8.45\", \"9.40\", \"10.48\", \"11.73\"],\n" +
            "                  \"head\": [\"42.7\", \"43.9\", \"45.1\", \"46.5\", \"47.8\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"1\",\n" +
            "                  \"month\": \"2\",\n" +
            "                  \"lable\": \"14个月\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"71.8\", \"74.5\", \"77.3\", \"80.2\", \"83.0\"],\n" +
            "                  \"weight\": [\"7.95\", \"8.82\", \"9.81\", \"10.95\", \"12.24\"],\n" +
            "                  \"head\": [\"43.17\", \"44.37\", \"45.57\", \"46.97\", \"48.27\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"1\",\n" +
            "                  \"month\": \"4\",\n" +
            "                  \"lable\": \"16个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"73.8\", \"76.6\", \"79.5\", \"82.5\", \"85.4\"],\n" +
            "                  \"weight\": [\"8.29\", \"9.20\", \"10.23\", \"11.41\", \"12.76\"],\n" +
            "                  \"head\": [\"43.57\", \"44.77\", \"46.00\", \"47.37\", \"48.70\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"1\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"一岁半\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"75.6\", \"78.5\", \"81.5\", \"84.6\", \"87.7\"],\n" +
            "                  \"weight\": [\"8.63\", \"9.57\", \"10.65\", \"11.88\", \"13.29\"],\n" +
            "                  \"head\": [\"43.9\", \"45.1\", \"46.4\", \"47.7\", \"49.1\"]\n" +
            "            },{\n" +
            "                  \"year\": \"1\",\n" +
            "                  \"month\": \"8\",\n" +
            "                  \"lable\": \"20个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"77.3\", \"80.3\", \"83.4\", \"86.7\", \"90.0\"],\n" +
            "                  \"weight\": [\"8.98\", \"9.96\", \"11.08\", \"12.37\", \"13.84\"],\n" +
            "                  \"head\": [\"44.23\", \"45.43\", \"46.73\", \"48.03\", \"49.43\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"1\",\n" +
            "                  \"month\": \"10\",\n" +
            "                  \"lable\": \"22个月\",\n" +
            "                  \"day_number\": \"28\",\n" +
            "                  \"height\": [\"78.9\", \"82.1\", \"85.3\", \"88.7\", \"92.2\"],\n" +
            "                  \"weight\": [\"9.31\", \"10.33\", \"11.51\", \"12.84\", \"14.39\"],\n" +
            "                  \"head\": [\"44.53\", \"45.73\", \"47.03\", \"48.33\", \"49.73\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"2\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"二岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"80.5\", \"83.8\", \"87.2\", \"90.7\", \"94.3\"],\n" +
            "                  \"weight\": [\"9.64\", \"10.70\", \"11.92\", \"13.31\", \"14.92\"],\n" +
            "                  \"head\": [\"44.8\", \"46.0\", \"47.3\", \"48.6\", \"50.0\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"2\",\n" +
            "                  \"month\": \"2\",\n" +
            "                  \"lable\": \"26个月\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"82.0\", \"85.4\", \"88.9\", \"92.6\", \"96.3\"],\n" +
            "                  \"weight\": [\"9.94\", \"11.04\", \"12.31\", \"13.75\", \"15.42\"],\n" +
            "                  \"head\": [\"45.07\", \"46.27\", \"47.57\", \"48.87\", \"50.20\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"2\",\n" +
            "                  \"month\": \"4\",\n" +
            "                  \"lable\": \"28个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"83.4\", \"86.9\", \"90.6\", \"94.3\", \"98.1\"],\n" +
            "                  \"weight\": [\"10.23\", \"11.37\", \"12.68\", \"14.18\", \"15.91\"],\n" +
            "                  \"head\": [\"45.30\", \"46.50\", \"47.80\", \"49.10\", \"50.43\"]\n" +
            "            },  {\n" +
            "                  \"year\": \"2\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"二岁半\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"84.8\", \"88.4\", \"92.1\", \"95.9\", \"99.8\"],\n" +
            "                  \"weight\": [\"10.52\", \"11.70\", \"13.05\", \"14.60\", \"16.39\"],\n" +
            "                  \"head\": [\"45.5\", \"46.7\", \"48.0\", \"49.3\", \"50.7\"]\n" +
            "            },{\n" +
            "                  \"year\": \"2\",\n" +
            "                  \"month\": \"8\",\n" +
            "                  \"lable\": \"32个月\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"86.2\", \"89.8\", \"93.6\", \"97.4\", \"101.3\"],\n" +
            "                  \"weight\": [\"10.80\", \"12.02\", \"13.41\", \"15.01\", \"16.87\"],\n" +
            "                  \"head\": [\"45.70\", \"46.90\", \"48.20\", \"49.50\", \"50.83\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"2\",\n" +
            "                  \"month\": \"10\",\n" +
            "                  \"lable\": \"34个月\",\n" +
            "                  \"day_number\": \"29\",\n" +
            "                  \"height\": [\"87.6\", \"91.2\", \"95.0\", \"98.8\", \"102.7\"],\n" +
            "                  \"weight\": [\"11.08\", \"12.34\", \"13.77\", \"15.42\", \"17.34\"],\n" +
            "                  \"head\": [\"45.87\", \"47.10\", \"48.37\", \"49.67\", \"51.00\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"3\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"三岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"88.9\", \"92.5\", \"96.3\", \"100.1\", \"104.1\"],\n" +
            "                  \"weight\": [\"11.36\", \"12.65\", \"14.13\", \"15.83\", \"17.81\"],\n" +
            "                  \"head\": [\"46.0\", \"47.3\", \"48.5\", \"49.8\", \"51.2\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"3\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"三岁半\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"91.9\", \"95.6\", \"99.4\", \"103.3\", \"107.2\"],\n" +
            "                  \"weight\": [\"12.16\", \"13.55\", \"15.16\", \"17.01\", \"19.17\"],\n" +
            "                  \"head\": [\"46.5\", \"47.7\", \"49.0\", \"50.3\", \"51.6\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"4\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"四岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"95.4\", \"99.2\", \"103.1\", \"107.0\", \"111.1\"],\n" +
            "                  \"weight\": [\"12.93\", \"14.44\", \"16.17\", \"18.19\", \"20.54\"],\n" +
            "                  \"head\": [\"46.9\", \"48.1\", \"49.4\", \"50.6\", \"52.0\"]\n" +
            "            },{\n" +
            "                  \"year\": \"4\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"四岁半\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"98.7\", \"102.7\", \"106.7\", \"110.9\", \"115.2\"],\n" +
            "                  \"weight\": [\"13.71\", \"15.33\", \"17.22\", \"19.42\", \"22.00\"],\n" +
            "                  \"head\": [\"47.2\", \"48.4\", \"49.7\", \"51.0\", \"52.3\"]\n" +
            "            },{\n" +
            "                  \"year\": \"5\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"五岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"101.8\", \"106.0\", \"110.2\", \"114.5\", \"118.9\"],\n" +
            "                  \"weight\": [\"14.44\", \"16.20\", \"18.26\", \"20.66\", \"23.50\"],\n" +
            "                  \"head\": [\"47.5\", \"48.7\", \"50.0\", \"51.3\", \"52.6\"]\n" +
            "            },{\n" +
            "                  \"year\": \"5\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"五岁半\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"104.9\", \"109.2\", \"113.5\", \"118.0\", \"122.6\"],\n" +
            "                  \"weight\": [\"15.18\", \"17.09\", \"19.33\", \"21.98\", \"25.12\"],\n" +
            "                  \"head\": [\"47.8\", \"49.0\", \"50.3\", \"51.5\", \"52.8\"]\n" +
            "            },{\n" +
            "                  \"year\": \"6\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"六岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"107.6\", \"112.0\", \"116.6\", \"121.2\", \"126.0\"],\n" +
            "                  \"weight\": [\"15.87\", \"17.94\", \"20.37\", \"23.27\", \"26.74\"],\n" +
            "                  \"head\": [\"48.0\", \"49.2\", \"50.5\", \"51.8\", \"53.1\"]\n" +
            "            }, {\n" +
            "                  \"year\": \"6\",\n" +
            "                  \"month\": \"6\",\n" +
            "                  \"lable\": \"六岁半\",\n" +
            "                  \"day_number\": \"31\",\n" +
            "                  \"height\": [\"110.1\", \"114.7\", \"119.4\", \"124.3\", \"129.2\"],\n" +
            "                  \"weight\": [\"16.55\", \"18.78\", \"21.44\", \"24.61\", \"28.46\"],\n" +
            "                  \"head\": []\n" +
            "            }, {\n" +
            "                  \"year\": \"7\",\n" +
            "                  \"month\": \"0\",\n" +
            "                  \"lable\": \"七岁\",\n" +
            "                  \"day_number\": \"30\",\n" +
            "                  \"height\": [\"112.6\", \"117.4\", \"122.3\", \"127.3\", \"132.4\"],\n" +
            "                  \"weight\": [\"16.67\", \"18.94\", \"21.64\", \"24.86\", \"28.78\"],\n" +
            "                  \"head\": []\n" +
            "            }]\n" +
            "      }";
}

